﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucGuiTinNhan.ascx.cs"
    Inherits="STT.Admin.UserControls.ucGuiTinNhan" %>

<%--<div id="content-header">
    <div id="breadcrumb">
        <a href="../Admin/Default.aspx?idpage=1" class="tip-bottom" data-original-title="Về bảng điều khiển">
            <i class="icon-home"></i>Trang chính
        </a>
        <a href="../Admin/Default.aspx?" class="current">Quản lý chung</a>
        <a href="../Admin/Default.aspx?" class="current">Gửi tin nhắn</a>
    </div>
</div>--%>

<div class="widget-box collapsible">
    <div class="widget-title">
        <span class="icon"><i class="icon-th"></i></span>
        <h5 runat="server" id="txtTieuDe">Cài đặt gửi tin</h5>
    </div>
    <div class="in collapse" id="collapseOne" style="height: auto;">
        <div class="widget-content nopadding">
            <div class="span6">
                <div class="control-group">
                    <label class="control-label">Đối tượng gửi tin: </label>
                    <div class="controls">
                        <asp:DropDownList ID="ddDoiTuongGui" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddDoiTuongGui_SelectedIndexChanged"></asp:DropDownList>
                    </div>
                </div>
            </div>
            <div class="span6">
                <div class="control-group">
                    <label class="control-label">Kiểu gửi tin: </label>
                    <div class="controls">
                        <asp:DropDownList ID="ddKieuGuiTin" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddKieuGuiTin_SelectedIndexChanged"></asp:DropDownList>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <asp:Panel ID="plGuiTNDa" runat="server">
    <div class="widget-title">
        <span class="icon"><i class="icon-th"></i></span>
       <%-- <h5 runat="server" id="H2">Gửi tin nhắn đa</h5>--%>
        <asp:Label ID="labLoaiGui" runat="server" Text="Label"></asp:Label>
    </div>
    <div class="in collapse" id="collapseThree" style="height: auto;">
        <div class="widget-content nopadding">
             <asp:Panel ID="plGuiChoHV" runat="server">
            <div class="span6">
                <div class="control-group">
                    <%--<label class="control-label">Gửi cho khóa học: </label>--%>
                    <div class="controls">
                        <asp:RadioButton ID="rbKhoaHoc" runat="server" GroupName="check" Text=" Gửi cho khóa học" AutoPostBack="True" OnCheckedChanged="rbKhoaHoc_CheckedChanged"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">Chọn khóa học: </label>
                    <div class="controls">
                        <asp:DropDownList ID="ddKhoaHoc" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddKhoaHoc_SelectedIndexChanged"></asp:DropDownList>
                    </div>
                </div>
            </div>
            <div class="span6">
                <div class="control-group">
                    <%--<label class="control-label">Gửi cho lớp học: </label>--%>
                    <div class="controls">
                        <asp:RadioButton ID="rbLopHoc" runat="server" GroupName="check" Text=" Gửi cho lớp học" AutoPostBack="True" OnCheckedChanged="rbLopHoc_CheckedChanged"/>
                    </div>
                </div>
                <div class="control-group">
                    <label class="control-label">Chọn lớp học: </label>
                    <div class="controls">
                        <asp:DropDownList ID="ddLopHoc" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddLopHoc_SelectedIndexChanged"></asp:DropDownList>
                    </div>
                </div>
            </div>
             </asp:Panel>

             <div class="control-group">
                <%--<label class="control-label">Người nhận: </label>--%>
                 <asp:Label Class="control-label" ID="labNguoiNhan" runat="server" Text="Người nhận:"></asp:Label>
                <div class="controls">
                    <asp:DropDownList ID="ddlNguoiNhan" runat="server"></asp:DropDownList>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">Nội dung: </label>
                <div class="controls">
                    <asp:TextBox ID="txtNoiDung" runat="server" TextMode="MultiLine" Rows="5" CssClass="span20"></asp:TextBox>
                </div>
            </div>
        </div>
    </div>
    </asp:Panel>
    <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">
        <asp:Button ID="btGui" runat="server" Text="Gửi" CssClass="btn btn-info" style="margin-top:10px;" OnClick="btGui_Click"/>
    </div>


    <div class="widget-title">
        <span class="icon"><i class="icon-th"></i></span>
        <h5 runat="server" id="H1">Danh sách tin nhắn đã gửi</h5>
    </div>
    <div class="in collapse" id="Div1" style="height: auto;">
        <div class="widget-content nopadding">
            <div id="DataTables_Table_0_wrapper" class="dataTables_wrapper" role="grid">
                    <asp:GridView ID="gvTinNhan" runat="server" CssClass="table table-bordered table-hover"
                        AutoGenerateColumns="False" DataKeyNames="MaTN"
                        OnRowCommand="gvTinNhan_RowCommand"
                        EnableViewState="False" OnRowDeleting="gvTinNhan_RowDeleting"
                        AllowPaging="True" PageSize="20">
                        <Columns>
                            <asp:TemplateField>
                                <HeaderTemplate>
                                    <asp:CheckBox ID="cbChonTat" runat="server" onclick="cbChonTat(this);" />
                                </HeaderTemplate>
                                <ItemTemplate>
                                    <asp:CheckBox ID="cbChon" runat="server" onclick="cbChon(this);" />
                                </ItemTemplate>
                                <ItemStyle Width="10px" HorizontalAlign="Center"></ItemStyle>
                            </asp:TemplateField>
                            <asp:BoundField DataField="MaTN" HeaderText="Mã tin nhắn"
                                SortExpression="MaTN" ItemStyle-CssClass="span2" Visible="False">
                                <ItemStyle CssClass="span2"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="TinNhan" HeaderText="Nội dung tin nhắn"
                                InsertVisible="False" ReadOnly="True" SortExpression="TenLop"
                                ItemStyle-CssClass="span1">
                                <ControlStyle Width="300px" />
                            <HeaderStyle Width="200px" />
                                <ItemStyle CssClass="span1"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="NguoiNhan" HeaderText="Người nhận"
                                InsertVisible="False" ReadOnly="True" SortExpression="NguoiNhan"
                                ItemStyle-CssClass="span1">
                                <ControlStyle Width="250px" />
                                <ItemStyle CssClass="span1"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="NgayGui" HeaderText="Ngày gửi"
                                InsertVisible="False" ReadOnly="True" SortExpression="NgayGui"
                                ItemStyle-CssClass="span1">
                                <ControlStyle Width="200px" />
                                <ItemStyle CssClass="span1"></ItemStyle>
                            </asp:BoundField>
                            <asp:BoundField DataField="NguoiGui" HeaderText="Người gủi" >

                            <ControlStyle Width="100px" />
                            </asp:BoundField>

                            <asp:TemplateField HeaderText="Xóa" ShowHeader="False">
                                <ItemTemplate>
                                    <%-- Bắt sự kiện nhấn nút xóa --%>
                                    <asp:LinkButton ID="LinkButton2" runat="server" CommandName="Delete" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa?');">
                                <img src="../../img/delete.jpg" alt="Alternate Text" />
                                    </asp:LinkButton>
                                </ItemTemplate>
                                <ItemStyle CssClass="span1" HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

                    <div class="fg-toolbar ui-toolbar ui-widget-header ui-corner-bl">

                        <asp:LinkButton ID="lbXoaTat" runat="server" CssClass="btn" OnClientClick="return ConfirmDelete('Có chắc bạn muốn xóa các dòng đã chọn?');"
                            OnClick="lbXoaTat_Click">Xóa chọn</asp:LinkButton>

                        
                      <div class="btn-group">
                 <asp:HyperLink ID="HyperLink2" CssClass="btn"  Target="_blank" runat="server" NavigateUrl="~/Report/ViewGuiTinNhan.aspx" >                        
                            Xuất dữ liệu
                    </asp:HyperLink>
                
                   
                </div>
                    </div>
                </div>
                
        </div>
    </div>


</div>
